<?php
/**
 * todu
 *
 * @copyright Copyright (c) 2018 Create-Chain PHP Group
 * @author    atangege
 */

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    protected $table = 'ccmall.ccmall_orders';

    const STATUS_CREATING = 1; // 订单创建中
    const STATUS_WAIT_FOR_PAY = 10; //待支付
    const STATUS_WAIT_FOR_DELIVERY = 20; //待发货
    const STATUS_WAIT_FOR_RECEIVE = 30; //待收货
    const STATUS_RECEIVED = 40; //用户确认收货
    const STATUS_TERMINATED = 90;// 系统确认收货
    const STATUS_CANCEL = 74; //用户取消订单
    const STATUS_EXPIRED = 70; //系统取消订单

    public static function multiple($status) {
        switch ($status) {
            case self::STATUS_CREATING:
                return '创建中';
            case self::STATUS_WAIT_FOR_PAY:
                return '待支付';
            case self::STATUS_WAIT_FOR_DELIVERY:
                return '待发货';
            case self::STATUS_WAIT_FOR_RECEIVE:
                return '待收货';
            case self::STATUS_RECEIVED:
            case self::STATUS_TERMINATED:
                return '已收货';
            case self::STATUS_CANCEL:
            case self::STATUS_EXPIRED:
                return '已取消';
            default:
                return '未知状态';
        }
    }
}
